import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    //   saveScrollPosition: true,
    routes: [
        //登陆的与导航栏是同级
        //登录页面
        {
            name: 'login',
            path: '/login',
            component: () => import('./views/login.vue')
        },
        {
            name: 'collegeLogin',
            path: '/collegeLogin',
            component: () => import('./views/collegeLogin.vue')
        },
        //以下是除去登陆页面之外的东西
        {
            path: '/v',
            name: 'frame',
            component: () => import('./views/frame/frame.vue'),
            children: [
                /*
                 *root 发展规划处
                 */
                {
                    name: 'root',
                    path: 'root',
                    component: resolve =>
                        void require(['./views/system/root.vue'], resolve),
                    beforeEach: (to, from, next) => {},
                    children: [
                        /**
                         *  数据分析页面
                         */
                        {
                            name: 'dataAnalysis',
                            path: 'analysis',
                            component: resolve =>
                                void require(['./views/dataAnalysis/putInto.vue'], resolve)
                        },
                        //指标设置页面
                        {
                            name: 'quotaHome',
                            path: 'TargetHome',
                            component: resolve =>
                                void require([
                                    './views/quotaManage/quotaHome.vue'
                                ], resolve)
                        },
                        //责任单位管理页面
                        {
                            name: 'ResHome',
                            path: 'Responsible',
                            component: resolve =>
                                void require([
                                    './views/Responsible/ResHome.vue'
                                ], resolve)
                        },
                        //学院管理页面
                        {
                            name: 'college',
                            path: '/',
                            component: resolve =>
                                void require([
                                    './views/college/CollegeHome.vue'
                                ], resolve)
                        },

                        //上报数据管理页面
                        {
                            name: 'dataManagement',
                            path: 'dataManagement',
                            component: resolve =>
                                void require([
                                    './views/commitRecord/responsibilityData.vue'
                                ], resolve)
                        },
                        {
                            name: 'commitRecords',
                            path: 'commitRecords',
                            component: resolve =>
                                void require([
                                    './views/commitRecord/commitRecords.vue'
                                ], resolve)
                        },
                        /**
                         * 排行管理页面
                         */
                        // 投入排行
                        {
                            path: 'adminInput',
                            name: 'adminInput',
                            component: () =>
                                import('./views/ranking/adminputRanking.vue')
                        },
                        // // 产出排行
                        {
                            path: 'adminOutput',
                            name: 'adminOutput',
                            component: () =>
                                import('./views/ranking/adminOutPutRanking.vue')
                        },
                        // 绩效排行
                        {
                            path: 'adminAchievement',
                            name: 'adminAchievement',
                            component: () =>
                                import(
                                    './views/ranking/adminAchievement-ranking.vue'
                                )
                        },

                        //系统设置页面
                        {
                            name: 'sys',
                            path: 'sys',
                            component: resolve =>
                                void require([
                                    './views/system/sys.vue'
                                ], resolve)
                        }
                    ]
                },
                /**
                 * 二级学院可看
                 * 路由暂时访问不到，所以还没有更改
                 */
                {
                    name: 'college',
                    path: 'college',
                    component: resolve =>
                        void require(['./views/system/college.vue'], resolve),
                    beforeEach: (to, from, next) => {},
                    children: [
                        /**
                         * 排行管理页面
                         */
                        // 投入排行
                        {
                            path: 'input',
                            name: 'input',
                            component: () =>
                                import('./views/ranking/input-ranking.vue')
                        },
                        // 产出排行
                        {
                            path: 'output',
                            name: 'output',
                            component: () =>
                                import('./views/ranking/output-ranking.vue')
                        },
                        // 绩效排行
                        {
                            path: 'achievement',
                            name: 'achievement',
                            component: () =>
                                import(
                                    './views/ranking/achievements-ranking.vue'
                                )
                        }
                    ]
                },
                /**
                 * 部门可看
                 */
                {
                    name: 'department',
                    path: 'mender',
                    component: resolve =>
                        void require([
                            './views/system/department.vue'
                        ], resolve),
                    beforeEach: (to, from, next) => {},
                  
                    children: [
                          //责任数据
                        {
                            name: 'responsibilityData',
                            path: 'responsibilityData',
                            component: resolve =>
                                void require([
                                    './views/department/dataManagement.vue'
                                ], resolve)
                        },
                        //提交记录
                        {
                            name: 'commitRecords',
                            path: 'commitRecords',
                            component: resolve =>
                                void require([
                                    './views/department/commitRecords.vue'
                                ], resolve)
                        },
                        
                    ]
                },
                /**
                 * 校长可看
                 * 数据分析页面
                 */
                {
                    name: 'president',
                    path: 'watcher',
                    component: resolve =>
                        void require(['./views/system/president.vue'], resolve),
                    beforeEach: (to, from, next) => {},
                    children: [
                        {
                            name: 'responsibilityData',
                            path: '/',
                            component: resolve =>
                                void require([
                                    './views/dataAnalysis/putInto.vue'
                                ], resolve)
                        }
                    ]
                }
            ]
        }
    ]
})